//! @Author: DengLibin
//! @Date: Create in 2023-11-01 21:50:48
//! @Description: 


/// @Author: DengLibin
/// @Date: Create in 2023-11-01 21:51:01
/// @Description: 分组
pub fn group_vec<T>(vec: Vec<T>, group_size: u32)->Vec<Vec<T>>{
    let mut sub_v: Vec<T> = Vec::with_capacity(group_size as usize);
    let mut vv: Vec<Vec<T>> = Vec::new();
    let mut i: u32 = 0;
    for e in vec {
        i += 1;
        sub_v.push(e);
        if i == group_size {
            vv.push(sub_v);
            sub_v = Vec::with_capacity(group_size as usize);
            i = 0;
        }
    }
    if i > 0 {
        vv.push(sub_v);
    }
    return vv;
}
